Skip to content

Migrate to pydantic v2 and switch tests to Polyfactory#550

Merged
wilbrdt merged 1 commit intomainfrom
structure/tests/pydantic-v2-and-polyfactory
Apr 19, 2024
Merged

Migrate to pydantic v2 and switch tests to Polyfactory#550
wilbrdt merged 1 commit intomainfrom
structure/tests/pydantic-v2-and-polyfactory

Conversation

@Leobouloc
Copy link
Copy Markdown
Contributor

@Leobouloc Leobouloc commented Jan 10, 2024

Purpose

Migrate to pydantic v2 for speed (as suggested: #401) and warren compatibility.

As hypothesis is no longer supported, it was decided to use polyfactory for model generation.

@Leobouloc Leobouloc added the WIP label Jan 10, 2024
Copy link
Copy Markdown
Contributor

@wilbrdt wilbrdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt
Huge work!

Comment thread src/ralph/api/__init__.py
Comment thread src/ralph/api/auth/basic.py Outdated
Comment thread src/ralph/api/auth/basic.py
Comment thread src/ralph/api/auth/oidc.py Outdated
Comment thread src/ralph/api/auth/user.py Outdated
Comment thread tests/models/edx/test_enrollment.py Outdated
Comment thread tests/models/test_converter.py Outdated
Comment thread tests/models/test_validator.py Outdated
Comment thread tests/models/test_validator.py
Comment thread tests/models/xapi/base/test_statements.py
Copy link
Copy Markdown
Collaborator

@SergioSim SergioSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing 👍

Can't wait to see this merged) have only a few optional minor questions)

image

Comment thread .env.dist Outdated
Comment thread docs/CHANGELOG.md
Comment thread docs/commands.md
Comment thread pyproject.toml Outdated
Comment thread tests/backends/data/test_async_lrs.py
Comment thread src/ralph/cli.py
Comment thread src/ralph/conf.py Outdated
Comment thread src/ralph/conf.py Outdated
Comment thread src/ralph/conf.py
Comment thread src/ralph/models/xapi/base/common.py Outdated
@Leobouloc Leobouloc force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from 00a2614 to 90be668 Compare January 24, 2024 18:54
@Leobouloc Leobouloc added improvement and removed WIP labels Jan 24, 2024
@Leobouloc Leobouloc force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from 548bcc5 to 81d37d4 Compare January 24, 2024 19:18
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from f4c8287 to f739ca3 Compare April 12, 2024 14:44
@wilbrdt wilbrdt self-assigned this Apr 12, 2024
@wilbrdt wilbrdt requested review from quitterie-lcs and wilbrdt and removed request for wilbrdt April 12, 2024 14:45
@wilbrdt wilbrdt added this to the 5.0 milestone Apr 12, 2024
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from e46e3b3 to de2d1d9 Compare April 16, 2024 08:24
Copy link
Copy Markdown
Contributor

@quitterie-lcs quitterie-lcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ralph/api/routers/statements.py
Comment thread src/ralph/models/xapi/base/ifi.py Outdated
Comment thread src/ralph/models/xapi/base/unnested_objects.py Outdated
Comment thread src/ralph/models/xapi/virtual_classroom/results.py Outdated
Comment thread tests/api/test_statements_get.py
@wilbrdt wilbrdt requested a review from quitterie-lcs April 18, 2024 07:33
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from de2d1d9 to 8ebdca5 Compare April 18, 2024 07:34
Copy link
Copy Markdown
Contributor

@quitterie-lcs quitterie-lcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrating to `pydantic` v2 should speed up processing and allow
interoperability with projects such as `warren`. This migration makes the
hypothesis package used in tests obsolete, which is why we introduce
`polyfactory`.
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from 8ebdca5 to 2f25e8b Compare April 19, 2024 15:17
@wilbrdt wilbrdt merged commit db52c78 into main Apr 19, 2024
@wilbrdt wilbrdt deleted the structure/tests/pydantic-v2-and-polyfactory branch April 19, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants